<template>
  <div class="home">
    <van-swipe
      class="my-swipe"
      :autoplay="3000"
      indicator-color="white"
    >
      <van-swipe-item
        v-for="item in lunbolist"
        :key='item.id'
      >
        <img
          :src="item.img"
          alt=""
        >
      </van-swipe-item>
    </van-swipe>
  </div>
</template>
<script>
import axios from 'axios'
export default {
  data: () => ({
    lunbolist: []
  }),
  methods: {
    async getlunbo() {
      const { data: { message } } = await axios.get('http://115.159.63.12:8888/api/getlunbo')
      this.lunbolist = message
    }
  },
  created() {
    this.getlunbo()
  }
}
</script>
<style lang="scss" scoped>
.home {
  .my-swipe {
    height: 200px;
    img {
      width: 100%;
      height: 100%;
    }
  }
}
</style>